#ifndef _UNARYOPERATION_
#define _UNARYOPERATION_

#include "Expression.h"
#include "UnaryOperationType.h"

class UnaryOperation: public Expression
{
public:
    UnaryOperation(TreeNode* iExpression, UnaryOperationType iOperation);
    virtual ~UnaryOperation();
    virtual void CheckVariables(set<string>& oVariables, string iParentName);
    virtual void CheckFunctionCalls(set<FunctionDefinition*>& iAllFunctions, string iParentName);
    virtual void CheckClassConstructions(set<ClassDefinition*>& iAllClasses, string iParentName);
    virtual void CheckExpressionTypes(map<string, ExpressionType*>& iVarTypes, string iParentName);
    virtual ExpressionType* GetType(map<string, ExpressionType*>& iVarTypes, string iParentName);
    virtual void Accept(GeneralVisitor* iVisitor);

    static bool IsTypeOK(ValueType iValType, UnaryOperationType iOp);

    TreeNode* GetExpression()           { return fExpression;   }
    UnaryOperationType GetOperation()   { return fOperation;    }

private:
    TreeNode* fExpression;
    UnaryOperationType fOperation;
};

#endif
